<?php
/*========================================= JooSam =========================================/
/																							/
/	Extention:		JooSam																	/
/	Created by:		ScriptPlanet.eu															/
/	Site:			http://www.scriptplanet.eu												/
/	Email:			support@scriptplanet.eu													/
/	Support:		http://www.scriptplanet.eu/support										/
/	Copyright:		2011 (c) ScriptPlanet.eu												/
/	License:		CC BY-NC-ND 3.0 ~ http://creativecommons.org/licenses/by-nc-nd/3.0/		/
/	File Version:	0001																	/
/																							/
/========================================== JooSam ========================================*/
// Joomla Security
defined('_JEXEC') or die;
JHtml::_('behavior.tooltip');

$data = $this->search;

if($data){
	if($data == 'norequest'){
		$res[] = array(
					'songid' => '',
					'artist' => JText::_('COM_JOOSAM_COM_REQUEST_AJAX_CLOSED'),
					'title' => ''
					);
	}
	else{
		foreach($data as $part){
			$res[] = array(
						'songid' => $part['ID'],
						'artist' => utf8_encode($part['artist']),
						'title' => utf8_encode($part['title'])
						);
		}
	}
}
else{
	$res = array();
}

echo json_encode($res); ?>